package mantel.metrics;

import static org.junit.Assert.*;

import java.util.ArrayList;

import genome.CGP;
import genome.Genotype;

import mantel.DistanceMatrix;

import org.junit.Before;
import org.junit.Test;

import tool.Utility;

public class InverseProbabilityMetricTest {

	private CGP g1;
	private CGP g2;
	private double[] default_input = {0.0,1.0};
	private int[] sample_genome1 = {0,0,0};
	private int[] sample_genome2 = {0,0,1};
	private int default_size = 3;
	private InverseProbabilityMetric ipm;
	private ArrayList<Genotype> gSpace;
	
	@Before
	public void setUp() throws Exception {
		g1 = new CGP(default_input,default_size);
		g2 = new CGP(default_input,default_size);
		
		ipm = new InverseProbabilityMetric();
	}

	@Test
	public void testDistGenotypeGenotype() {
		System.out.println(ipm.dist(g1,g2));
	}

	@Test
	public void testDistArrayListOfGenotype() {
		gSpace = g1.generateSpace();
		DistanceMatrix dm = ipm.dist(gSpace);
		System.out.println(dm);
		
		double[][] dmFull = dm.toArray();
		Utility.printMat(dmFull);
	}

}
